home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 138
/
Volume 138 Aug 19 2011 - Damaged.iso
/
Games
/
shadez.swf
/
scripts
/
Local
/
Game
/
Thing
/
CWeaponFBAA.as
< prev
next >
Wrap
Text File
|
2011-08-19
|
3KB
|
123 lines
package Local.Game.Thing
{
import Local.Game.World.CAngle;
import Local.Game.World.CPosition;
public class CWeaponFBAA extends CWeapon
{
public static var _Upgrades:Array;
{
if(true)
{
_Upgrades = [{
"mName":"",
"mAmmo":INFINATEAMMO,
"mAutoFire":true,
"mFireRate":5,
"mDamage":100,
"mRange":INFINATERANGE
}];
}
}
private var mGunIndex:int;
public function CWeaponFBAA()
{
super();
§§push(§§findproperty(mAngleRange));
§§push("min");
§§push(-90 * 256);
if(true)
{
§§push(§§pop() / 360);
}
§§pop().mAngleRange = null;
mTargetAngle = new CAngle();
mUpgrade = 0;
mFireRate = Math.floor(mFireRate / mEnemySpeed);
mType = "gunfbaa";
Process = Process_Normal;
mGunIndex = 0;
mOrientation = 1;
AddAnimation("stand",TruckFlatbedAA_Gun,"AddSprite_Black");
AddSound("fire_0",AA_Gun_Fire_1);
AddSound("fire_1",AA_Gun_Fire_2);
AddSound("fire_2",AA_Gun_Fire_3);
}
override public function Fire() : void
{
AddThing(new CShotBullet(GetShotPosition("gun" + (mGunIndex + 1)),mAngle.mDelta,20));
mAnimationFrame = (mGunIndex + 1) * 0.25;
§§push(§§findproperty(mGunIndex));
§§push(mGunIndex + 1);
if(true)
{
§§push(§§pop() % 3);
}
§§pop().mGunIndex = §§pop();
PlaySound("fire_" + mGunIndex);
IncrementFired();
}
public function SetTarget(param1:CThingMain) : Boolean
{
if(true)
{
mCurrentTarget = param1;
}
return true;
}
public function GetShotPosition(param1:String) : CPosition
{
return GetObjectPosition(param1,mPosition);
}
override public function get mWeaponName() : String
{
return "gunm1a1";
}
override public function Draw() : void
{
super.Draw();
DrawSprite(GetOrientationMatrix());
}
public function Process_Normal() : void
{
var _loc1_:CAngle = null;
var _loc2_:CPosition = null;
if(true)
{
if(mCurrentTarget)
{
_loc2_ = CPosition.SUBTRACT(mCurrentTarget.mCollide.mMid,mPosition);
if(true)
{
mTargetAngle.mDelta = _loc2_;
}
}
else
{
mTargetAngle.mAngle256 = -(64 + 32);
}
}
_loc1_ = new CAngle(mTargetAngle.mAngle - mAngle.mAngle);
mAngle.mAngle += _loc1_.mAngle * 0.5;
mAnimationFrame = 0;
WeaponUpdate();
Process_Children();
}
override public function get mUpgrades() : Array
{
return _Upgrades;
}
}
}